package com.study.concurrent;

public class SynchronizedTest {
	private Object lock = new Object();

	public synchronized void test(){
		//修饰普通方法 锁定当前实例对象
	}

	public synchronized static void test1(){
		//修饰静态方法 锁定class对象
	}

	public synchronized void test2(){

	}

	public  void test3(){
		//修饰代码块
		synchronized (lock){
			//操作
		}
	}
}
